package mygui;

import java.awt.event.*;
import java.io.*;
import javax.swing.*;

import kernel.*;

public class ActionResultsStudio extends AbstractAction
{
    MonIHM _gui;

    public ActionResultsStudio(MonIHM gui){
	_gui = gui;
	putValue(AbstractAction.NAME, "Results studio");
	putValue(AbstractAction.SHORT_DESCRIPTION, "Open the result studio");
	putValue(AbstractAction.SMALL_ICON, UIM.createImageIcon("images/results.png",""));
    }
		 
    public void actionPerformed(ActionEvent e){
	ResultStudio result = ResultStudio.getInstance();
	if(Simulator.getSimulator().getResultManager().isGenerated()){
	    result.open(Simulator.getSimulator().getResultManager().getResultFile());
	    result.show();
	    result.toFront();
	    _gui.toBack();
	}
    }
}